package jp.sourceforge.akjrcp.videotools.subtitlemaker;

import java.io.File;

public class ThumbnailPreference {
	 private String videoPath;
	 private double fps=1.0;
	 public  String baseDir="temporary/thumbs/";
	 private String baseName="videothumbs";
	 private String extension="jpg";
	 private int width;
	 private int height;
	public String getVideoPath() {
		return videoPath;
	}
	public void setVideoPath(String videoPath) {
		this.videoPath = videoPath;
	}
	public void clearOldFiles(){
		File dir=new File(baseDir);
		if(dir.exists()){
		String[] files=dir.list();
		for (int i = 0; i < files.length; i++) {
			if(files[i].startsWith(baseName)){
				File f=new File(dir,files[i]);
				if(f.isFile()){
					f.delete();
				}
			}
		}
		}
	}
	
	public double getFps() {
		return fps;
	}
	public void setFps(double fps) {
		this.fps = fps;
	}
	public String getBaseDir() {
		if(!baseDir.endsWith("/")){
			return baseDir+"/";	//must end /
		}else{
		return baseDir;
		}
	}
	public void setBaseDir(String baseDir) {
		this.baseDir = baseDir;
	}
	public String getBaseName() {
		return baseName;
	}
	public void setBaseName(String baseName) {
		this.baseName = baseName;
	}
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
}
